<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
<title>Hello APP</title>
<link rel="stylesheet" type="text/css" href="../../css/aui-flex.css" />
<link rel="stylesheet" type="text/css" href="../../css/aui.css" />
<link rel="stylesheet" type="text/css" href="../../css/common.css" />
<style>
</style>
</head>

<body>
<header class="aui-bar aui-bar-nav" id="header">
	<div class="aui-pull-left back" tapmode onclick="api.closeWin()"></div>
	<div class="aui-title">我的订单</div>
	<div class="aui-pull-right"  tapmode onclick="openWin('order_search_win')"><img src="../../image/common/03.png" style="height:1rem" alt="">
	</div>
</header>
<div class="aui-tab" id="order-tab">
	<div class="aui-tab-item aui-active" tapmode onclick="tabType(0)">全部</div>
	<div class="aui-tab-item" tapmode onclick="tabType(1)">待付款</div>
	<div class="aui-tab-item" tapmode onclick="tabType(2)">待发货</div>
	<div class="aui-tab-item" tapmode onclick="tabType(3)">待收货</div>
	<div class="aui-tab-item" tapmode onclick="tabType(4)">已完成</div>
</div>
</body>
<script type="text/javascript" src="../../script/import.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript">
	var index = 0;
	apiready = function() {
		api.parseTapmode();
		var header = $api.byId('header');
		$api.fixStatusBar(header);
		var headerH = $api.offset(header).h;
		var tabH = $api.offset($api.byId('order-tab')).h;
		if(api.pageParam.type){
			index = parseInt(api.pageParam.type);
		}
		api.openFrame({
		    name: 'order1_frm',
		    url: 'order1_frm.html',
		    rect: {
		        x: 0,
		        y: headerH + tabH,
		        w: 'auto',
		        h: 'auto'
		    },
			reload: true,
		    pageParam: {
		        name: 'test'
		    },
		    bounces: false,
		});


	};
	function tabType(index){
			$$('#order-tab > div').removeClass('aui-active').eq(index).addClass('aui-active');
			if(index == 4){
				index = -1
			}
			api.execScript({
					frameName: 'order1_frm',
					script: 'changeStatus(' + index + ')'
			});
	}


	function openWin(url){
			api.openWin({
					name: url,
					url: url + '.html'
			});
	}
</script>
</html>
